home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs36.d81
/
vdcram15.sda
/
VDC RDEXT2.S
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2009-10-10
|
17KB
|
700 lines
100 SYS700
101 .OPT P
102 *=$B8B0
103 ENDCHR = $08:COUNT = $0B
104 VALTYP = $0D:GARBFL = $0F
105 INDEX = $22:FORPNT = $49
106 JMPER = $54:FACHO = $62
107 FBUFPT = $71:CHRGET = $73
108 CHR(null)T = $79:TXTPTR = $7A
109 LDTB1 = $D9:ZP = $FB
110 BUF = $200:VECSAV = $2A7
111 ICRNCH = $304:ERROR = $A437
112 LINKPG = $A533:CRNCH = $A57C
113 PLOOP = $A6F3:PRIT4 = $A6EF
114 QPLOP = $A71A:NEWSTT = $A7AE
115 (null)NE = $A7E4:OUTDO = $AB47
116 CHKNUM = $AD8D:FRMEVL = $AD9E
117 EVAL = $AE86:PARCHK = $AEF1
118 CHKCOM = $AEFD:FRESTR = $B6A3
119 GETNUM = $B7EB:GETADR = $B7F7
120 FLOATC = $BC49:OUTINT = $BDCD
121 NEWTOK = $CC:DATTOK = $49
122 REMTOK = $55:FUNTOK = $D0
123 ;
124 ;RAM DISK FILENAME BUFFER
125 ;
126 FILNAME = *
127 .ASC "@@@@@@@@@@@@@@@@"
128 FNSIZE = *-FILNAME
129 ;
130 ;RAM DISK DIRECTORY
131 ;
132 DIRBUFF = *
133 .ASC "@@@@@@@@@@@@@@@@"
134 .ASC "@@@@@@@@@@@@@@@@"
135 .ASC "@@@@@@@@@@@@@@@@"
136 .ASC "@@@@@@@@@@@@@@@@"
137 .ASC "@@@@@@@@@@@@@@@@"
138 .ASC "@@@@@@@@@@@@@@@@"
139 .ASC "@@@@@@@@@@@@@@@@"
140 .ASC "@@@@@@@@@@@@@@@@"
141 .ASC "@@@@@@@@@@@@@@@@"
142 .ASC "@@@@@@@@@@@@@@@@"
143 .ASC "@@@@@@@@@@@@@@@@"
144 .ASC "@@@@@@@@@@@@@@@@"
145 .ASC "@@@@@@@@@@@@@@@@"
146 .ASC "@@@@@@@@@@@@@@@@"
147 .ASC "@@@@@@@@@@@@@@@@"
148 BUMAX = *-DIRBUFF
149 ;
150 ;MAX NUMBER OF DIR ENTRIES
151 ;
152 FNMAX = 15
153 ;
154 ;RAM DISK FILE ENTRIES
155 ;CORRESPOND 1 TO 1 WITH
156 ;FILENAMES, FIRST 2 BYTES
157 ;EQUALS FILE LENGTH, NEXT
158 ;2 BYTES EQUAL STARTING
159 ;POSITION IN 64 RAM, NEXT
160 ;2 BYTES EQUAL STARTING
161 ;POSITION IN VDC RAM
162 ;THIS IS THE SAME FOR ALL
163 ;15 RAMDISK FILE ENTRIES
164 ;
165 DIRBYT = *
166 .BYTE 0,0,0,0,0,0
167 MAX =*-DIRBYT
168 .BYTE 0,0,0,0,0,0
169 .BYTE 0,0,0,0,0,0
170 .BYTE 0,0,0,0,0,0
171 .BYTE 0,0,0,0,0,0
172 .BYTE 0,0,0,0,0,0
173 .BYTE 0,0,0,0,0,0
174 .BYTE 0,0,0,0,0,0
175 .BYTE 0,0,0,0,0,0
176 .BYTE 0,0,0,0,0,0
177 .BYTE 0,0,0,0,0,0
178 .BYTE 0,0,0,0,0,0
179 .BYTE 0,0,0,0,0,0
180 .BYTE 0,0,0,0,0,0
181 .BYTE 0,0,0,0,0,0
182 BYMAX = *-DIRBYT
183 ;
184 ;NEXT AVAILABLE POSITION
185 ;IN RAM DISK
186 ;
187 NDBYTE .BYTE 0,0
188 ;
189 ;MISC. POINTERS AND FLAGS
190 ;
191 FLAG16 .BYTE 0
192 MEMMAX .BYTE 0,0
193 ENDP .BYTE 0,0
194 RESULT .BYTE 0,0,0
195 RMSRT .BYTE 0,0
196 TEMP .BYTE 0
197 FLENN .BYTE 0
198 DIRPOS .BYTE 0
199 ;
200 ;ADDRESS OF BLOCK TO MOVE
201 ;
202 BLOCK1 .BYTE 0,0
203 ;
204 ;ADDRESS OF BLOCK TO MOVE TO
205 ;
206 BLOCK2 .BYTE 0,0
207 ;
208 ;NUMBER OF BYTES TO MOVE
209 ;
210 NUMBER .BYTE 0,0
211 ;
212 ;COUNT FOR REMAINING BYTES TO MOVE
213 ;
214 COUNTER .BYTE 0,0
215 ;
216 ;ERROR MESSAGE ROUTINE
217 ;
218 LONERR LDA #$00:.BYTE $2C
219 FULERR LDA #$01:.BYTE $2C
220 EXTERR LDA #$02:.BYTE $2C
221 FNFERR LDA #$03
222 ERRROU ASL:TAX:LDA ERRVEC,X
223 : STA INDEX:LDA ERRVEC+1,X
224 : STA INDEX+1:JMP DOEROR
225 ERRVEC .WORD TLONG
226 : .WORD FULLMESS
227 : .WORD FALREAD
228 : .WORD FNFMESS
229 ;
230 ;RAM DISK CATALOG MESSAGES
231 ;
232 .ASC "64 MODE VDC RAM DISK"
233 .ASC " FROM "
234 .ASC "DBSOFT"
235 DIRTI =*
236 .ASC " FILENAME [146] START [146]"
237 .ASC " LENGTH [146]":.BYTE 13
238 .ASC "---------------------------"
239 .ASC "-------------":.BYTE 0
240 DIREMP =*
241 .ASC "NO FILES IN RAM DISK"
242 .BYTE 0
243 VDCFRE =*
244 .ASC " BYTES FREE [146]":.BYTE 13,0
245 ;
246 ;CHECK AMOUNT OF MEMORY THEN
247 ;ADJUST TOP OF RAMDISK MEMORY
248 ;
249 CHKMEM LDA #<65535:STA VDCLOBYT
250 : LDA #>65535:STA VDCHIBYT
251 : LDA #219:STA VDCDATA
252 : JSR POKE1:LDA #<32767
253 : STA VDCLOBYT:LDA #>32767
254 : STA VDCHIBYT:JSR PEEK1
255 : CMP #219:BEQ ONLY16
256 (null)OD64 LDA #255:STA MEMMAX+1
257 : STA MEMMAX:JSR REG28S
258 : LDA 54785:CMP #255
259 : BEQ CMEXIT:JSR REG28S
260 : LDA #63:STA 54785:RTS
261 ONLY16 LDA #64:STA MEMMAX+1
262 : LDA #1:STA FLAG16
263 CMEXIT RTS
264 REG28S LDA #28:STA 54784:JSR WAIT1
265 : RTS
300 ;
301 ;FIND FILENAME IN DIRECTORY
302 ;THAT IS CONTAINED IN THE
303 ;BUFFER CALLED FILNAME
304 ;IF PRESENT .A WILL HOLD
305 ;DIRECTORY ENTRY NUMBER
306 ;ELSE .A WILL HOLD 255
307 ;
308 FNENT LDA #0:STA DIRPOS
309 : LDA #<FILNAME:STA ZP
310 : LDA #>FILNAME:STA ZP+1:LDX #0
311 FINDLP LDY #0
312 INFLP LDA (ZP),Y:CMP DIRBUFF,X
313 : BNE INCXC:INY:INX:CPY FLENN
314 : BNE INFLP:JMP MATCH
315 INCXC INC DIRPOS:LDY DIRPOS:LDA #0
316 ADDLP CLC:ADC #FNSIZE:TAX:DEY
317 : BNE ADDLP:LDA DIRPOS
318 : CMP #FNMAX:BCC FINDLP
319 : LDA #255:STA DIRPOS:RTS
320 MATCH LDA DIRPOS:RTS
321 SETFNM LDY #FNSIZE-1:LDA #"@"
322 FILP STA FILNAME,Y:DEY:BNE FILP
323 ;
324 ;EVALUATE EXPRESSION,
325 ;GET STRING INFORMATION,
326 ;PREPARE 0 PAGE POINTER
327 ;
328 : JSR SETML1:STX ZP:STY ZP+1
329 : STA FLENN:CMP #FNSIZE
330 : BCC GCOPY:LDA #FNSIZE-1
331 : STA FLENN
332 ;
333 ;COPY FILENAME TO BUFFER
334 ;
335 GCOPY LDY FLENN
336 CPYLP LDA (ZP),Y:STA FILNAME,Y:DEY
337 : BPL CPYLP:RTS
338 ;
339 ;THE JOB OF THIS ROUTINE
340 ;IS TO FIND THE NEXT
341 ;BLANK DIRECTORY ENTRY
342 ;
343 FINBLENT LDA #0:STA TEMP:LDX #0
344 FBLLP LDA DIRBUFF,X
345 ;
346 ;CMP "@" IF = ENTRY BLANK
347 ;
348 : CMP #"@":BEQ BLANK:INC TEMP
349 : LDY TEMP:LDA #0
350 ALLP CLC:ADC #FNSIZE:DEY:BNE ALLP
351 : TAX:CPX #BUMAX:BCC FBLLP
352 : LDA #255:RTS
353 ;
354 ;LDA DIRECTORY ENTRY POS
355 ;AND RETURN
356 ;
357 BLANK LDA TEMP:RTS
358 ;
359 ;FILL DIRECTORY ENTRIES
360 ;Y=0 DON'T ENTER LOOP
361 ;
362 PUTNAM LDA #0:LDY TEMP:CPY #0
363 : BEQ STPUT
364 ;
365 ;SET Y=TO CORRECT DIRBYT OFFSET
366 ;
367 PUTALP CLC:ADC #MAX:DEY:BNE PUTALP
368 ;
369 ;STORE FILE PARAMETERS
370 ;
371 STPUT TAY:LDA PLEN:STA DIRBYT,Y:INY
372 : LDA PLEN+1:STA DIRBYT,Y:INY
373 : LDA START:STA DIRBYT,Y:INY
374 : LDA START+1:STA DIRBYT,Y:INY
375 : LDA RMSRT:STA DIRBYT,Y:INY
376 : LDA RMSRT+1:STA DIRBYT,Y
377 : LDA #0:LDY TEMP:CPY #0
378 : BEQ STFPT
379 ;
380 ;SET Y=TO CORRECT DIRBUFF OFFSET
381 ;
382 PFLP CLC:ADC #FNSIZE:DEY:BNE PFLP
383 STFPT LDX #0:TAY
384 ;
385 ;ACTUAL TRANSFER OF
386 ;FILENAME OCCURS HERE
387 ;
388 STFPLP LDA FILNAME,X:STA DIRBUFF,Y
389 : INY:INX:CPX FLENN:BCC STFPLP
390 : RTS
391 ;
392 ;CHECK PROGRAM LENGTH, IS HT
393 ;LESS THAN AVAILABLE VDC MEMORY
394 ;
395 CHFILEN SEC:LDA ENDP:SBC START
396 : STA PLEN:LDA ENDP+1
397 : SBC START+1:STA PLEN+1
398 : LDA #0:SBC #0:STA RESULT+2
399 : LDA FLAG16:CMP #1
400 : BEQ MAXME0:LDA RESULT+2
401 : CMP #0:BNE TOOLONG
402 : JMP CHFILN1
403 ;
404 ;FILE TOO LONG PRINT ERROR MESSAGE
405 ;
406 MAXME0 LDA PLEN+1:CMP MEMMAX+1
407 : BCS TOOLONG
408 ;
409 ;SET END OF PRG POINTER
410 ;
411 CHFILN1 CLC:LDA PLEN:ADC NDBYTE
412 : STA RESULT:LDA PLEN+1
413 : ADC NDBYTE+1:STA RESULT+1
414 : LDA #0:ADC #0:STA RESULT+2
415 : LDA FLAG16:CMP #1
416 : BEQ MAXME1:LDA RESULT+2
417 : CMP #0:BNE TOOLONG
418 : JMP CHFILN2
419 ;
420 ;CHECK TO MAKE SURE FILE FITS
421 ;INTO AVAILABLE VDC MEMORY
422 ;
423 MAXME1 LDA RESULT+1:CMP MEMMAX+1
424 : BCS TOOLONG
425 CHFILN2 LDA #0:RTS
426 TOOLONG LDA #255:RTS
427 SETRMP LDY #0:LDA (122),Y:CMP #","
428 : BNE ITSBASIC
429 : JMP ITSML
430 ITSBASIC LDA 43:STA START
431 : STA BLOCK1:LDA 45:STA ENDP
432 : LDA 44:STA START+1
433 : STA BLOCK1+1:LDA 46
434 : STA ENDP +1:LDA 45
435 ;
436 ;SET UP PROPER VALUES FOR
437 ;MDINIT ROUTINE, STORE
438 ;NUMBER OF BYTES TO MOVE
439 ;
440 : SEC:LDA 45:SBC 43
441 : STA NUMBER:LDA 46:SBC 44
442 : STA NUMBER+1
443 ;
444 ;SET START BLOCK
445 ;
446 SETBL LDA NDBYTE:STA BLOCK2
447 : STA RMSRT:LDA NDBYTE+1
448 : STA BLOCK2+1:STA RMSRT+1:RTS
449 ;
450 ;SAME AS ABOVE EXCEPT M/L
451 ;
452 ITSML JSR SETML2:STY START
453 : STY BLOCK1:STA START+1
454 : STA BLOCK1+1:JSR SETML2
455 : STY ENDP:STA ENDP+1:LDA ENDP
456 : SEC:SBC START:STA NUMBER
457 : LDA ENDP+1:SBC START+1
458 : STA NUMBER+1:JMP SETBL
459 SETUP JSR (null)FAST:JSR SETFNM
460 : JSR FNENT:RTS
461 ;
462 ;BLANK SCREEN AND GOTO
463 ;FAST MODE, SET FILENAME,
464 ;CHECK FOR DUP NAME IF +
465 ;IT ALREADY EXISTS, SET
466 ;PARAMS FOR MOVE, CHECK
467 ;LENGTH OF PRG IF - IT'S
468 ;TOO LONG TO FIT IN RAMDISK
469 ;
470 RSAV JSR SETUP:BPL ALREADY
471 : JSR SETRMP:JSR CHFILEN
472 : BPL NXSUB:JSR RLEXIT
473 : JMP LONERR
474 ;
475 ;FIND NEXT BLANK DIR ENTRY
476 ;IF- DIR FULL PRINT ERR MSG
477 ;
478 NXSUB JSR FINBLENT:BPL GEXIT
479 : JSR RLEXIT:JMP FULERR
480 ;
481 ;PUT NAME IN DIR, PREPARE
482 ;FOR MOVE, DO IT
483 ;
484 GEXIT JSR PUTNAM:JSR MDINIT
485 : JSR MOVEUP:CLC:LDA RESULT
486 ;
487 ;STORE NEXT POS. LO IN RAM DISK
488 ;
489 : ADC #1:STA NDBYTE
490 ;
491 ;STORE NEXT POS. HI IN RAM DISK
492 ;
493 : LDA RESULT+1:ADC #0
494 : STA NDBYTE+1:JSR FRERAM
495 : JMP RLEXIT
496 FRERAM SEC:LDA MEMMAX:LDX MEMMAX+1
497 : SBC NDBYTE:TAY:TXA
498 : SBC NDBYTE+1:TAX:TYA
499 : STA MEMFRE:STX MEMFRE+1:RTS
500 ;
501 ;ALL DONE RETURN TO BASIC
502 ;
503 RLEXIT JSR (null)SLOW:RTS
504 ALREADY JSR RLEXIT:JMP EXTERR
505 ;
506 ;SET PARAMS TO LOAD FROM
507 ;RAM DISK
508 ;
509 SETPLD LDY DIRPOS:CPY #0:BEQ SETP
510 : LDA #0
511 PADDLP CLC:ADC #MAX:DEY:BNE PADDLP
512 SETP TAY:LDA DIRBYT,Y:STA NUMBER
513 : INY:LDA DIRBYT,Y:STA NUMBER+1
514 : INY:LDA DIRBYT,Y:STA BLOCK2
515 : INY:LDA DIRBYT,Y:STA BLOCK2+1
516 : INY:LDA DIRBYT,Y:STA BLOCK1
517 : INY:LDA DIRBYT,Y:STA BLOCK1+1
518 : RTS
519 ;
520 ;SET UP PARAMS, DO MOVE
521 ;
522 DORAMLD JSR MDINIT:JSR MOVEDN:RTS
523 ;
524 ;BLANK SCREEN AND GOTO
525 ;FAST MODE, SET FILENAME,
526 ;CHECK TO SEE IF EXISTS
527 ;IF + IT DOES, IF NOT
528 ;PRINT ERROR MESSAGE,
529 ;SET PARAMS FOR MDINIT,
530 ;DO LOAD, CHECK TO SEE
531 ;IF BASIC, IF NOT EXIT
532 ;ELSE SET END PROGRAM,
533 ;RELINK LINES,GOTO SLOW
534 ;MODE AND RETURN
535 ;
536 RLOA JSR SETUP:BPL NXROOT:JMP FNFND
537 NXROOT JSR SETPLD:JSR DORAMLD
538 : LDA BLOCK2+1:CMP 46
539 : BNE RLOEXT:LDA ZP+2:STA 45
540 : STA 47:STA 49:LDA ZP+3
541 : STA 46:STA 48:STA 50
542 : JSR RELINK
543 RLOEXT JSR (null)SLOW:RTS
544 FNFND JSR RLOEXT:JMP FNFERR
545 MDINIT LDA BLOCK1:STA ZP
546 : LDA BLOCK1+1:STA ZP+1
547 : LDA BLOCK2:STA ZP+2
548 : LDA BLOCK2+1:STA ZP+3
549 : LDX NUMBER:LDY NUMBER+1:RTS
550 MOVEDN JSR SCOUNT1
551 DOWNLP JSR GETVDC:STA (ZP+2),Y
552 : JSR ADDONE:DEC COUNTER
553 : BNE DOWNLP:DEC COUNTER+1
554 : LDA COUNTER+1:CMP #255
555 : BNE DOWNLP:RTS
556 MOVEUP JSR SCOUNT1
557 MOUPLP LDA (ZP),Y:JSR PUTVDC
558 : JSR ADDONE:DEC COUNTER
559 : BNE MOUPLP:DEC COUNTER+1
560 : LDA COUNTER+1:CMP #255
561 : BNE MOUPLP:RTS
562 ADDONE INC ZP:BNE INCTAR:INC ZP+1
563 INCTAR INC ZP+2:BNE ADEXIT:INC ZP+3
564 ADEXIT RTS
565 SCOUNT1 STX COUNTER:STY COUNTER+1
566 : LDY #0:RTS
567 ;
568 ;BLANK SCREEN AND GOTO FAST MODE
569 ;
570 (null)FAST LDA 53265:AND #239:LDX #1
571 : JMP SETMODE
572 ;
573 ;FIX SCREEN AND GOTO SLOW MODE
574 ;
575 (null)SLOW LDA 53265:ORA #16:LDX #0
576 SETMODE STA 53265:STX 53296:RTS
577 ;
578 ;ROUTINES TO READ & WRITE
579 ;TO VDC MEMORY
580 ;
581 GETVDC LDA ZP:STA VDCLOBYT:LDA ZP+1
582 : STA VDCHIBYT:JSR PEEK1
583 : LDA VDCDATA:RTS
584 PUTVDC STA VDCDATA:LDA ZP+2
585 : STA VDCLOBYT:LDA ZP+3
586 : STA VDCHIBYT:JSR POKE1
587 : RTS
588 ;
589 ;STORE DATA TO VDC MEMORY
590 ;
591 POKE1 JSR PEEK2:JSR SETLO
592 : LDA VDCDATA:STA 54785:RTS
593 ;
594 ;READ DATA FROM VDC MEMORY
595 ;
596 PEEK1 JSR PEEK2:JSR WAIT1:JSR SETLO
597 : LDA 54785:STA VDCDATA:RTS
598 ;
599 ;MISC. VDC ROUTINES
600 ;
601 SETLO LDA VDCLOBYT:STA 54785
602 : LDA #31:STA 54784
603 WAIT1 LDA 54784:AND #128:BEQ WAIT1
604 : RTS
605 PEEK2 LDA #18:STA 54784:JSR WAIT1
606 : LDA VDCHIBYT:STA 54785
607 : LDA #19:STA 54784:RTS
608 ;
609 ;INITIALIZE THE RAM DISK
610 ;
611 RDCLEAR LDX #0:LDA #"@"
612 RC1 STA DIRBUFF,X:INX:CPX #BUMAX-1
613 : BEQ RDBYTE:JMP RC1
614 RDBYTE LDX #BYMAX+1:LDA #0
615 RC2 STA DIRBYT,X:DEX:BPL RC2
616 : JSR FRERAM:RTS
617 ;
618 ;ROUTINE TO DISPLAY CATALOG
619 ;
620 DIRGET LDA #0:STA TEMPDA
621 : STA TEMPDA+1:LDA #<DIRTI
622 : LDY #>DIRTI:JSR PRTROU
623 : JSR CARRET:JSR FINBLENT
624 : CMP #0:BEQ RDEMP:CMP #255
625 : BNE TEMDIR:LDA #FNMAX
626 TEMDIR STA TEMP
627 DIRLP1 DEC TEMP:JSR FILFNA
628 : JSR PRTNAM:LDA #<FILNAME
629 : LDY #>FILNAME:JSR PRTROU
630 : LDA #19:STA 211:LDX START
631 : LDA START+1:JSR PRTINT
632 : LDA #30:STA 211:JSR AOTPLE
633 : LDX PLEN:LDA PLEN+1
634 : JSR PRTINT:LDA TEMP:CMP #0
635 : BEQ DIRFRE:JSR CARRET
636 : JMP DIRLP1
637 DIRFRE JSR CARRET:JSR FRERAM
638 : LDX MEMFRE:LDA MEMFRE+1
639 : JSR PRTINT:LDA #<VDCFRE
640 : LDY #>VDCFRE:JSR PRTROU:RTS
641 RDEMP LDA #<DIREMP:LDY #>DIREMP
642 : JSR PRTROU:JMP DIRFRE
643 CARRET LDA #13:JSR 65490:RTS
644 PRTNAM LDA #0:LDY TEMP:CPY #0
645 : BEQ PARGET
646 PRTALP CLC:ADC #MAX:DEY:BNE PRTALP
647 PARGET TAY:LDA DIRBYT,Y:STA PLEN
648 : INY:LDA DIRBYT,Y:STA PLEN+1
649 : INY:LDA DIRBYT,Y:STA START
650 : INY:LDA DIRBYT,Y:STA START+1
651 : LDA #0:LDY TEMP:CPY #0
652 : BEQ NAZERO
653 NAMADJ CLC:ADC #FNSIZE:DEY
654 : BNE NAMADJ
655 NAZERO LDX #0:TAY
656 NAMGET LDA DIRBUFF,Y:CMP #"@"
657 : BEQ NADONE:STA FILNAME,X
658 : INY:INX:JMP NAMGET
659 NADONE LDA #0:STA FILNAME,X:RTS
660 : RTS
661 FILFNA LDY #0:LDA #"@"
662 FILLNA STA FILNAME,Y:INY
663 : CPY #FNSIZE:BNE FILLNA
664 : RTS
665 PRTROU STA ZP:STY ZP+1:LDY #0
666 PRTLP1 LDA (ZP),Y:CMP #0
667 : BEQ PRTEXT:JSR 65490:INY
668 : JMP PRTLP1
669 PRTEXT RTS
670 AOTPLE CLC:LDA PLEN:LDX PLEN+1
671 : ADC #1:TAY:TXA:ADC #0:TAX
672 : TYA:STA PLEN:STX PLEN+1:RTS
673 *=$C000
674 INSTAL LDX #$07
675 INSTL1 LDA ICRNCH,X:STA VECSAV,X
676 : LDA IVECS,X:STA ICRNCH,X:DEX
677 : BPL INSTL1:JSR MEMCHK:RTS
678 IVECS .WORD TOKNIZ
679 : .WORD PRTOK
680 : .WORD EXEST
681 : .WORD EXEFUN
682 KEYTXT .ASC "RCA":.BYTE "T"+128
683 : .ASC "RINI":.BYTE "T"+128
684 : .ASC "RLO":.BYTE "A"+128
685 : .ASC "RSA":.BYTE "V"+128
686 : .ASC "FRA":.BYTE "M"+128
687 : .BYTE 0
688 STVEC .WORD RAMDIR-1
689 : .WORD RAMINT-1
690 : .WORD RAMLOD-1
691 : .WORD RAMSAV-1
692 FUNVEC .WORD FRAM
693 TOKNIZ JSR CRNCH:LDX #$00:LDY #$04
694 : STY GARBFL
695 CRN1 LDA BUF,X
696 CRN2 STA ENDCHR:CMP #$22
697 : BEQ SKQUOT:BIT GARBFL
698 : BVS MOVE:CMP #"A":BCC MOVE
699 : CMP #$5B:BCS MOVE
700 : STY FBUFPT:LDY #NEWTOK-$80
701 : STY COUNT:LDY #$FF
702 : STX TXTPTR:DEX
703 CRN3 INY:INX
704 CRN4 LDA BUF,X:SEC:SBC KEYTXT,Y
705 : BEQ CRN3:CMP #$80
706 : BNE NEXTKW:ORA COUNT
707 CRN5 LDY FBUFPT
708 MOVE INX:INY:STA BUF-5,Y
709 : LDA BUF-5,Y:BEQ EXIT:SEC
710 : SBC #":":BEQ MOVE1
711 : CMP #DATTOK:BNE MOVE2
712 MOVE1 STA GARBFL
713 MOVE2 SEC:SBC #REMTOK:BNE CRN1
714 : STA ENDCHR
715 SKIP1 LDA BUF,X:BEQ MOVE
716 : CMP ENDCHR:BEQ MOVE
717 SKQUOT INY:STA BUF-5,Y:INX
718 : BNE SKIP1
719 NEXTKW LDX TXTPTR:INC COUNT
720 NEXT1 INY:LDA KEYTXT-1,Y:BPL NEXT1
721 : LDA KEYTXT,Y:BNE CRN4
722 : LDA BUF,X:BPL CRN5
723 EXIT STA BUF-3,Y:LDA #$FF
724 : STA TXTPTR:RTS
725 PRTOK BPL PRINT1:CMP #$FF
726 : BEQ PRINT1:BIT GARBFL
727 : BMI PRINT1:CMP #NEWTOK
728 : BCC OLDPR:SEC:SBC #NEWTOK-1
729 : TAX:STY FORPNT:LDY #$FF
730 PRTOK1 DEX:BEQ PRLOOP
731 PRTOK2 INY:LDA KEYTXT,Y:BPL PRTOK2
732 : BMI PRTOK1
733 PRLOOP INY:LDA KEYTXT,Y:BMI PRINT2
734 : JSR OUTDO:BNE PRLOOP
735 PRINT1 JMP PLOOP
736 PRINT2 JMP PRIT4
737 OLDPR JMP QPLOP
738 EXEST JSR CHRGET:CMP #NEWTOK
739 : BCC OLDEXE:JSR EXE1
740 : JMP NEWSTT
741 EXE1 SBC #NEWTOK:ASL:TAY
742 : LDA STVEC+1,Y:PHA
743 : LDA STVEC,Y:PHA:JMP CHRGET
744 OLDEXE JSR CHR(null)T:JMP (null)NE+3
745 EXEFUN LDA #$00:STA VALTYP
746 : JSR CHRGET:CMP #$FF
747 : BEQ OLDFUN:CMP #FUNTOK
748 : BCC OLDFUN:SEC:SBC #FUNTOK
749 : ASL:PHA:JSR CHRGET
750 : JSR PARCHK:PLA:TAY
751 : LDA FUNVEC,Y:STA JMPER+1
752 : LDA FUNVEC+1,Y:STA JMPER+2
753 : JSR JMPER:JMP CHKNUM
754 OLDFUN JSR CHR(null)T:JMP EVAL+7
755 ;
756 ;DATA NEEDED FOR BASIC ROM
757 ;ROUTINES, ALL OTHERS ARE
758 ;UNDER BASIC ROM
759 ;VDCDATA ALSO EQUATES WITH TEMPDA
760 ;VDCLOBYT EQUATES WITH TEMPDA+1
761 ;
762 MEMFRE =*
763 .BYTE 0,0 ;BYTES FREE IN RAMDISK
764 PLEN =*
765 .BYTE 0,0 ;FILE LENGTH- LO,HI
766 START =*
767 .BYTE 0,0 ;FILE START-- LO,HI
768 TEMPDA =*
769 VDCDATA =*
770 .BYTE 0 ;DATA TO STORE TO VDC
771 VDCLOBYT =*
772 .BYTE 0 ;VDC LOCATION (LO-BYTE)
773 VDCHIBYT =*
774 .BYTE 0 ;VDC LOCATION (HI-BYTE)
775 ;
776 ;RAM DISK ERROR MESSAGES
777 ;
778 TLONG =*
779 .ASC "FILE TOO LON[199]"
780 FULLMESS =*
781 .ASC "DIRECTORY FUL[204]"
782 FALREAD =*
783 .ASC "FILE EXIST[211]"
784 FNFMESS =*
785 .ASC "FILE NOT FOUN[196]"
786 ;
787 ;RAM ROUTINES FOR ML UNDER ROM
788 ;BANK BASIC IN, DO WORK,
789 ;THEN BANK BASIC OUT
790 ;
791 SETML1 JSR BANBIN:JSR FRMEVL
792 : JSR FRESTR:JMP BABOUT
793 SETML2 JSR BANBIN:JSR CHKCOM
794 : JSR FRMEVL:JSR GETADR
795 : JMP BABOUT
796 RELINK JSR BANBIN:JSR LINKPG
797 : JMP BABOUT
798 PRTINT JSR BANBIN:JSR OUTINT
799 : JMP BABOUT
800 DOEROR JSR BANBIN:JMP ERROR+16
801 ;
802 ;BANK BASIC ROM OUT
803 ;
804 BABOUT PHA:LDA 1:AND #254
805 : JMP BIOSET
806 ;
807 ;BANK BASIC ROM IN
808 ;
809 BANBIN PHA:LDA 1:ORA #1
810 BIOSET STA 1:PLA:RTS
811 ;
812 ;RAM VECTORS FOR ML
813 ;UNDER BASIC ROM, SWITCH
814 ;OUT BASIC, DO WORK,
815 ;SWITCH BASIC BACK IN
816 ;
817 RAMLOD JSR BABOUT:JSR RLOA
818 : JMP BANBIN;RAMDISK LOAD
819 RAMSAV JSR BABOUT:JSR RSAV
820 : JMP BANBIN;RAMDISK SAVE
821 RAMINT JSR BABOUT:JSR RDCLEAR
822 : JMP BANBIN;RAMDISK INIT
823 RAMDIR JSR BABOUT:JSR DIRGET
824 : JMP BANBIN;RAMDISK CATALOG
825 MEMCHK JSR BABOUT:JSR CHKMEM
826 : JMP BANBIN;CHK AMT MEMORY
827 ;
828 ;FREE RAMDISK MEMORY FUNCTION
829 ;
830 FRAM LDA MEMFRE:STA FACHO+1
831 : LDA MEMFRE+1:STA FACHO
832 : LDX #$90:SEC:JSR FLOATC:RTS